package com.zhuoyue.biz.core.api.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zhuoyue.biz.core.api.domain.base.BaseDoClass;

import java.io.Serializable;

import com.zhuoyue.biz.core.api.dto.req.DistanceReportDTO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * @author wjming
 * @ClassName: AppUserPositionInformation
 * @Description: 用户位置信息
 * @Date 2021-07-09 10:52
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "`tbl_app_user_position_information`")
public class AppUserPositionInformation extends BaseDoClass implements Serializable {
    /**
     * 用户Id
     */
    @TableField(value = "`user_id`")
    private String userId;

    /**
     * 经度
     */
    @TableField(value = "`longitude`")
    private Double longitude;

    /**
     * 纬度
     */
    @TableField(value = "`latitude`")
    private Double latitude;

    /**
     * 位置
     */
    @TableField(value = "`position`")
    private String position;

    private static final long serialVersionUID = 1L;


    public AppUserPositionInformation dtoToDo(DistanceReportDTO distanceReport) {
        this.userId = distanceReport.getAppUserId();
        this.longitude = distanceReport.getLongitude();
        this.latitude = distanceReport.getLatitude();
        this.position = distanceReport.getPosition();
        return this;
    }
}